// @ts-ignore
/* eslint-disable */
import { request } from "@umijs/max";

/** 获取当前的用户 */
export async function userinfo(options?: { [key: string]: any }) {
  return request<UserTypes.UserInfo>("/user/info", {
    method: "GET",
    ...(options || {}),
  });
}

/** 获取用户列表  */
export async function userList(data: UserTypes.UserParam) {
  return request<API.PageResult<UserTypes.UserVO>>("/user/list", {
    method: "POST",
    data,
  });
}

/** 更新用户信息  */
export async function userUpdate(data: UserTypes.UserUpdateParam) {
  return request<boolean>("/user/update", {
    method: "POST",
    data,
  });
}

/** 创建用户  */
export async function userCreate(data: UserTypes.UserUpdateParam) {
  return request<boolean>("/user/create", {
    method: "POST",
    data,
  });
}

/** 创建用户  */
export async function userDelete(id: number) {
  return request<boolean>("/user/delete", {
    method: "DELETE",
    params: {
      id: id,
    },
  });
}
